package springBoot_dzfpxt.web.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import springBoot_dzfpxt.custom.CaozuoUtils;


@Controller
public class LoginController {
	
	@Autowired
	private CaozuoUtils caozuoUtils;

	@RequestMapping(value="/Beforemain", method=RequestMethod.GET)
	public synchronized String Beforemain() {
		caozuoUtils.savecaozuo("登录");
		return "redirect:/";
	}
	
	@RequestMapping(value="/login", method=RequestMethod.GET)
	public String login() {
		return "login";
	}
	
	@RequestMapping(value= {"/","/rtlogin"})
	public String main() {
		return "main";
	}
	
	@RequestMapping(value="/beforelogout")
	public synchronized String beforelogout(HttpSession session) {
		caozuoUtils.savecaozuo("登出");
		return "redirect:logout";
	}
	
}